<!-- 
Copyright (c) Guangzhou Data Control Network Technology Co., Ltd. All rights reserved. 
Licensed under the MIT License.
contact:dcdev_founder@foxmail.com 
-->


<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <!-- 数控开发基础样式库（已作一定的自适应，button/label/input/textarea等设置了默认样式） -->
    <link class="_dcdev_preset_" type="text/css" rel="stylesheet"
        href="https://res.dcdev.net/dcdev/v1.0.6/assets/css/dcdevui.css">
    <!-- 页面标题 -->
    <title>数控开发 · 预览代码片段</title>

    <!-- 桌面端浏览器及收藏夹图标 -->
    <link class="_dcdev_preset_" rel="icon" href="https://www.dcdev.net/icon.png" type="image/x-icon">
    <link class="_dcdev_preset_" rel="shortcut icon" href="https://www.dcdev.net/icon.png" type="image/x-icon">


</head>

<body>
    <!------ dcdev_body_container不要删除,内容在 body start 及 body end 中间书写  ------>
    <div class="dcdev-body-container" id="dcdev_body_container">
        <!-- body start -->
        <button onclick="e()">loading</button>

        <button onclick="a()">success</button>
        <button onclick="b()">error</button>
        <button onclick="show_message()">show_message</button>
        <button onclick="show_confirm()">show_confirm</button>


        <button onclick="c()">短内容</button>
        <button onclick="d()">长内容</button>
        <!-- body end -->
    </div>
</body>

<!------ 以下内容不要变动 --------------------------------------------------------->
<script class="_dcdev_preset_" src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<!-- 不授权模式，仅初始化常用变量及函数 -->
<script class="_dcdev_preset_" src="https://res.dcdev.net/dcdev/v1.0.6/assets/js/init.js" id="initClass"
    authorize_mode="none" console_mode=""></script>
<script class="_dcdev_preset_" src="./ui.js" id="ui_class" xhr_show_loading=1></script>


<!------ 以上内容不要变动 --------------------------------------------------------->

<script>
    function e() {
        ui_class.show_loading();
    }

    function a() {
        var data = {
            timeout: 2,
            is_mask: true,
            mask_opacity: 0.8,
            confirm_button: false,
        }
        ui_class.show_success("这是正确.", null, function (res) {

        })
    }

    function b() {
        var data = {
            timeout: 1,
            is_mask: true,
            mask_opacity: 0.3,
            confirm_button: false,
        }
        ui_class.show_error("这是错误!", data, function (res) {

        })
    }

    function show_confirm() {
        var data = {
            timeout: 5,
            is_mask: true,
            mask_opacity: 0.8,
        }
        ui_class.show_confirm("确定要删除此文件？", data, function (res) {
            console.log(res);
        })
    }

    function show_message() {
        var data = {
            timeout: 60,
            is_mask: true,
            mask_opacity: 0.8,
            confirm_button: true,
        }
        ui_class.show_message("请在Chrome打开以下载.", data, function (res) {
            console.log(res);
        })
    }

    function c() {
        ui_class.show_inputor({
            type: "char",
            title: "新建代码片段",
            opacity: 0.2,
            min_value: 4,
            max_value: 20,
        }, function (res) {
            console.log(res);
        })

    }

    function d() {
        ui_class.show_inputor({
            type: "textarea",
            title: "新建代码片段",
            min_value: 4,
            max_value: 140,
        }, function (res) {
            console.log(res);
        })
    }
</script>

</html>